<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
  layout:decorator="layouts/layout" th:with="header='盘点计划', subtext='管理系统中盘点计划数据'" style="overflow: hidden;">

<head>
  <title>盘点单</title>
</head>
<body style="overflow: hidden;">

  <th:block layout:fragment="content">
    <div  id="query-area" class="box-body m-b-sm border-bottom">
      <form class="form-horizontal search-form" role="form">
        <div class="row">

          <div class="col-sm-3">
            <div class="form-group">
              <label class="control-label col-sm-3">盘点单号</label>
              <div class="col-sm-9">
                <input type="text" id="documentNumber" name="documentNumber" placeholder="输入单号或参考号搜索" class="form-control" />
              </div>
            </div>
          </div>

            <div class="col-sm-3">
                <div class="form-group">
                    <label class="control-label col-sm-3">物料编码</label>
                    <div class="col-sm-9">
                        <input type="text" id="materialcode" name="materialcode" placeholder="输入物料编码搜索" class="form-control" />
                    </div>
                </div>
            </div>

            <div class="col-sm-3">
                <div class="form-group">
                    <label class="control-label col-sm-3">物料描述</label>
                    <div class="col-sm-9">
                        <input type="text" id="materialname" name="materialname" placeholder="输入物料描述搜索" class="form-control" />
                    </div>
                </div>
            </div>

            <div class="col-sm-3">
                <div class="form-group">
                    <label class="control-label col-sm-3">物料WBS</label>
                    <div class="col-sm-9">
                        <input type="text" id="lotattr07" name="lotattr07" placeholder="输入物料WBS搜索" class="form-control" />
                    </div>
                </div>
            </div>



            <!--
                      <div class="col-sm-3">
                        <div class="form-group">
                          <label class="control-label col-lg-3">单证类型</label>
                          <div class="col-lg-9">
                            <select id="type" name="type" class="form-control">
                              <option value="">请选择</option>
                              <option th:each="a : ${@CODES.findByType('CO_TYPE')}" th:value="${a.value}" th:text="${a.name}" />
                            </select>
                          </div>
                        </div>
                      </div>
            -->

          <div class="col-sm-3">
            <div class="form-group">
              <label class="control-label col-lg-3">单证状态</label>
              <div class="col-lg-9">
                <select id="status" name="status" class="form-control">
                  <option value="">请选择</option>
                  <option th:each="a : ${@CODES.findByType('CO_STATUS')}" th:value="${a.value}" th:text="${a.name}" />
                </select>
              </div>
            </div>
          </div>


            <div class="col-sm-3">
                <div class="form-group">
                    <label class="control-label col-sm-3">容器编码</label>
                    <div class="col-sm-9">
                        <input type="text" id="containnum" name="containnum" placeholder="输入容器编码搜索" class="form-control" />
                    </div>
                </div>
            </div>

            <div class="col-sm-3">
                <div class="form-group">
                    <label class="control-label col-lg-3 label-width-1">时间</label>
                    <div class="col-lg-9"> <input id="fromdate" name="fromdate" class="form-control form_datetime">
                    </div>
                </div>
            </div>
            <div class="col-sm-3">
                <div class="form-group">
                    <label class="control-label col-lg-3 label-width-1">至</label>
                    <div class="col-lg-9"> <input id="todate" name="todate" class="form-control form_datetime">
                    </div>
                </div>
            </div>




          <!--
          <div class="col-sm-3">
            <div class="form-group">
              <label class="control-label col-lg-3">物料</label>
              <div class="col-lg-9">
                <select id="material" name="material" class="form-control select2">
                  <option value="">请选择</option>
 	                  <option th:each="a : ${@DATAS.materials}" th:value="${a.id}" th:text="${a.name}" th:selected="${params['material'] == ''+a.id}" />
                </select>
              </div>
            </div>
          </div>
           -->
        <div class="row m-t">
          <div class="col-lg-12 seach-button">
            <div class="pull-right">
              <button type="submit" id="search" class="btn btn-primary">
                <i class="fa fa-search"></i> 搜索
              </button>
              <button type="reset" id="clear" class="btn btn-danger">
                <i class="fa fa-remove"></i> 清除
              </button>
            </div>
          </div>
        </div>
        </div>
      </form>
    </div>

    <div class="row">
      <div class="col-lg-12">
        <div class="box">
          <div class="box-body">
            <h2>

              <a  class="btn btn-primary btn-sm" th:href="@{|${baseUrl}/add|}" th:title="添加盘点单">
                <i class="fa fa-fw fa-plus"></i> 添加
              </a>
                <a  class="btn btn-info btn-sm" th:href="@{|${baseUrl}/ca/import|}" th:title="导入">
                    <i class="fa fa-fw fa-plus"></i> 导入
                </a>

                <a  class="btn btn-warning btn-sm genDetailsAll" href="javascript:;" th:title="生成盘点明细">
                    <i class="fa fa-fw fa-plus"></i> 生成盘点明细
                </a>

              <button type="button" class="btn btn-success btn-sm workstationAll">
                  <i class="fa fa-edit"></i> 盘点站台
              </button>

              <a  class="btn btn-danger btn-sm genTaskAll" href="javascript:;" th:title="生成盘点任务并下发设备执行">
                 <i class="fa fa-fw fa-plus"></i>开始盘点
              </a>
              <!--
              <a  class="btn btn-primary btn-sm printAll" href="javascript:;" th:title="打印任务标签">
                <i class="fa fa-fw fa-plus"></i>打印任务标签
              </a>
            -->
              <a  class="btn btn-primary btn-sm deliverAll" href="javascript:;" th:title="确认盘点结果，自动根据差异进行调账">
                <i class="fa fa-fw fa-plus"></i> 发布
              </a>
              <a  class="btn btn-info btn-sm closeAll" href="javascript:;" th:title="关闭盘点单">
                  <i class="fa fa-remove"></i>关闭
              </a>
              <a  class="btn btn-danger btn-sm delAll" href="javascript:;" th:title="删除盘点订单">
                <i class="fa fa-fw fa-trash"></i> 删除
              </a>
            </h2>
            <div id="tableWrapper">
              <table id="table" class="table table-striped table-hover table-bordered table-fixed">
                  <thead style="position:sticky;top:0;z-index:10;">
                  <tr>
                      <th style="width:50px;">
                          <a href="javascript:;" class="selectAll" title="全选">全选</a>
                      </th>


                    <th style="width:100px;">盘点单号</th>
                    <th style="width:120px;">计划盘点时间</th>
                    <th style="width:100px;">盘点站台</th>
                    <th style="width:60px;">详情</th>
                    <th style="width:60px;">来源</th>
                    <th style="width:120px;">创建时间</th>
                    <th style="width:60px;">状态</th>

<!--                    <th style="width:40px;">激活</th>-->
                    <th style="width:100px;">操作</th>

                  </tr>
                </thead>
                <tbody>
                </tbody>
              </table>
            </div>
          </div>
        </div>
      </div>
    </div>


    <form id="genDetailsForm" method="post" style="display: none" th:action="@{|${baseUrl}/ca/gendetails|}">
      <input id="ids" type="hidden" name="ids" />
    </form>

    <form id="genTaskForm" method="post" style="display: none" th:action="@{|${baseUrl}/ca/gentask|}">
      <input id="ids" type="hidden" name="ids" />
    </form>

    <form id="printForm" method="post" style="display: none" th:action="@{|${baseUrl}/print|}">
      <input id="ids" type="hidden" name="ids" />
    </form>

    <form id="deliverForm" method="post" style="display: none" th:action="@{|${baseUrl}/ca/deliver|}">
      <input id="ids" type="hidden" name="ids" />
    </form>

    <form id="closeForm" method="post" style="display: none" th:action="@{|${baseUrl}/close|}">
      <input id="ids" type="hidden" name="ids" />
    </form>

    <form id="delForm" method="post" style="display: none" th:action="@{|${baseUrl}/del|}">
      <input id="ids" type="hidden" name="ids" />
    </form>


      <div class="modal fade" id="workStationModal" tabindex="-1">
          <div class="modal-dialog">
              <div class="modal-content">
                  <div class="modal-header">
                      <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                      <h4 class="modal-title">盘点站台选中</h4>
                  </div>
                  <div class="modal-body">
                      <form id="workstationForm" method="post" th:action="@{|${baseUrl}/ca/workstation|}">
                          <input id="ids" type="hidden" name="ids"/>
                          <div class="row">

                              <div class="col-md-6">
                                  <div>
                                      <input type="checkbox" name="workstations-x-allbox" id="workstations-x-allbox" value="">
                                      <label for="workstations-x-allbox"><font size="16" color="aqua">库西区</font></label>
                                  </div>
                                  <div>
                                      <input type="checkbox" name="workstations" value="PA1023" id="workstation-x1">
                                      <label for="workstation-x1">拣选口1</label>
                                  </div>
                                  <div>
                                      <input type="checkbox" name="workstations" value="PA1028" id="workstation-x2">
                                      <label for="workstation-x2">拣选口2</label>
                                  </div>
                                  <div>
                                      <input type="checkbox" name="workstations" value="PA1033" id="workstation-x3">
                                      <label for="workstation-x3">拣选口3</label>
                                  </div>
                                  <div>
                                      <input type="checkbox" name="workstations" value="PA1038" id="workstation-x4">
                                      <label for="workstation-x4">拣选口4</label>
                                  </div>
                              </div>

                              <div class="col-md-6">
                                  <div>
                                      <input type="checkbox" name="workstations-d-allbox" id="workstations-d-allbox" value="">
                                      <label for="workstations-d-allbox"><font size="16" color="aqua">库东区</font></label>
                                  </div>
                                  <div>
                                      <input type="checkbox" name="workstations" value="PA2023" id="workstation-d1">
                                      <label for="workstation-d1">拣选口1</label>
                                  </div>
                                  <div>
                                      <input type="checkbox" name="workstations" value="PA2028" id="workstation-d2">
                                      <label for="workstation-d2">拣选口2</label>
                                  </div>
                                  <div>
                                      <input type="checkbox" name="workstations" value="PA2033" id="workstation-d3">
                                      <label for="workstation-d3">拣选口3</label>
                                  </div>
                                  <div>
                                      <input type="checkbox" name="workstations" value="PA2038" id="workstation-d4">
                                      <label for="workstation-d4">拣选口4</label>
                                  </div>
                              </div>


                          </div>

                      </form>
                  </div>
                  <div class="modal-footer">
                      <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                      <button type="button" class="btn btn-primary" id="workstation-btn">确定</button>
                  </div>
              </div>
          </div>
      </div>

      <!-- Modal -->
      <div class="modal fade" id="coDetailModal" tabindex="-1">
          <div class="modal-dialog" style="width:90%;">
              <div class="modal-content">
                  <div class="modal-header">
                      <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                      <h4 class="modal-title">订单详情</h4>
                  </div>
                  <div class="modal-body">
                      <iframe style="width: 100%; height: 450px;" frameborder="0"></iframe>
                  </div>

              </div>
          </div>
      </div>

  </th:block>

  <th:block layout:fragment="scripts">
    <script th:inline="javascript">
      var VALUES_MAP_DICT_TYPE = /*[[${@CODES.valuesMapOfType('CO_TYPE')}]]*/ {};
      var VALUES_MAP_DICT_STATUS = /*[[${@CODES.valuesMapOfType('CO_STATUS')}]]*/ {};
    </script>
    <script th:src="@{|${theme}/js/app/inventory/co_list.js?v=${applicationVersion}|}" th:inline="javascript"></script>
      <script th:src="@{|${theme}/plugins/datetimepicker/bootstrap-datetimepicker.min.js?v=${applicationVersion}|}" th:inline="javascript"></script>
      <script th:src="@{|${theme}/plugins/datetimepicker/locales/bootstrap-datetimepicker.zh-CN.js?v=${applicationVersion}|}" th:inline="javascript"></script>

  </th:block>
</body>

</html>
